<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title></title>
		<style type="text/css">
			body {
			    font: 12px/150% Arial,Verdana,"\5b8b\4f53";
			    color: #666;
			    background: #fff;
			}
			.main, .promotion {
			    background-color: #fff;
			    padding-bottom: 50px;
			}
			.w {width: 990px; margin: 0 auto;}
			.order {position: relative;}
			.clearfix {display: block;}
			.order.order-init .o-left {
		    padding-left: 0;
		    -moz-transition: all .15s ease-in-out;
		    -webkit-transition: all .15s ease-in-out;
		    transition: all .15s ease-in-out;
		}
		.order .o-left {
		    float: left;
		    width: 640px;
		    padding-top: 32px;
		    padding-bottom: 32px;
		}
		.order .o-title {
		    line-height: 26px;
		    height: 26px;
		    overflow: hidden;
		    color: #333;
		    font-weight: 400;
		    font-size: 14px;
		    font-family: "Microsoft Yahei";
		}
		h2, h3 {font-size: 14px;}
		.order.order-init.order-init-oldUser .o-tips, .order.order-init.order-init-oldUser-noQrcode .o-tips {
		    visibility: visible;
		    opacity: 1;
		}
		.order .o-right {
		    float: right;
		    width: 190px;
		    padding-top: 32px;
		    padding-bottom: 10px;
		    padding-right: 10px;
		    overflow: hidden;
		}
		.order .o-price {text-align: right;line-height: 26px;}
		.order .o-price em {vertical-align: bottom;}
		em {font-style: normal;}
		.order .o-price strong {font-size: 18px;vertical-align: bottom;color: #e31613;margin: 0 3px;}
		.order .o-detail {text-align: right;line-height: 20px;color: #67a4ff;}
		.order .o-detail a {display: inline-block;padding-right: 15px;position: relative;}
		a {color: #67a4ff;}		
		a {text-decoration: none;}
		.order .o-list {
		    display: block;
		    padding: 12px 0 25px;
		    margin: 0 30px;
		    clear: both;
		    border-top: 1px solid #ddd;
		}
		.order .o-list .o-list-info {line-height: 24px;}
		.mr10 {margin-right: 10px;}
		.clearfix:after {
		    content: ".";
		    display: block;
		    height: 0;
		    clear: both;
		    visibility: hidden;
		}
		.payment {
		    background-color: #fff;
		    padding: 12px 30px 0;
		    -moz-box-shadow: 0 6px 32px rgba(0,0,0,.13);
		    -webkit-box-shadow: 0 6px 32px rgba(0,0,0,.13);
		    box-shadow: 0 6px 32px rgba(0,0,0,.13);
		}
		.p-w-bd, .pay-weixin {zoom: 1;}
		.p-w-hd {margin-bottom: 20px;font-size: 18px;font-family: "Microsoft Yahei";}
		.p-w-bd {padding-left: 130px;margin-bottom: 30px;}
		.p-w-box {float: left;width: 300px;}
		.pw-box-hd {margin-bottom: 20px;border: 1px solid #ddd;width: 298px;height: 298px;}
		.pw-box-ft {height: 44px;padding: 8px 0 8px 125px;
    				background: url(__PUBLIC__/img/icon-red.png) 50px 8px no-repeat #ff7674;}
		.pw-box-ft p {margin: 0;font-size: 14px;line-height: 22px;color: #fff;font-weight: 700;}
		.p-w-sidebar {float: left;width: 379px;height: 421px;padding-left: 50px;margin-top: -20px;background: url(__PUBLIC__/img/phone-bg.png) 50px 0 no-repeat;}
		.p-w-bd:after, .pay-weixin:after {display: table;content: "";clear: both;}
	</style>
	</head>
	<body>
		<div class="main">
		    <div class="w">
		        <!-- order 订单信息 -->
                <div class="order clearfix order-init order-init-oldUser-noQrcode">
		    	<!-- 订单信息 -->
				    <div class="o-left">
				    	<h3 class="o-title">订单提交成功，请尽快付款！订单号：{$order_number}</h3>
				        <p class="o-tips">
                            <span class="o-tips-time" id="deleteOrderTip"></span>				
				        </p>
				    </div>
				    <div class="o-list j_orderList" id="listPayOrderInfo" style="display: block;font-size: 14px;">
						<div class="o-list-info">
						    <span>商品名称：{$proName}</span>
							<span class="o-price" style="margin-left: 20px;"><em>应付金额</em><strong>{$money}</strong><em>元</em></span>
						</div>
					 </div>
				</div>
				<input type="hidden" name="out_trade_no" class="out_trade_no" value="{$order_number}">
		        <!-- order 订单信息 end -->
		        <!-- payment 支付方式选择 -->
		        <div class="payment">
		            <!-- 微信支付 -->
		            <div class="pay-weixin">
		                <div class="p-w-hd">微信支付</div>
		                <div class="p-w-bd" style="position:relative">
		                    <div class="p-w-box">
		                        <div class="pw-box-hd">
		                            <img id="weixinImageURL" src="{:U('Pay/code')}?url={$url}" width="298" height="298">
		                        </div>
		                        <div class="pw-retry j_weixiRetry" style="display: none;">
		                            <a class="ui-button ui-button-gray j_weixiRetryButton" href="javascript:getWeixinImage2();">获取失败 点击重新获取二维码  </a>
		                        </div>
		                        <div class="pw-box-ft">
		                            <p>请使用微信扫一扫</p>
		                            <p>扫描二维码支付</p>
		                        </div>
		                    </div>
		                    <div class="p-w-sidebar"></div>
		                </div>
		            </div>
		            <!-- 微信支付 end -->
		            <!-- payment-change 变更支付方式 -->
		            <!--<div class="payment-change">
		                <a class="pc-wrap" onclick="window.history.go(-1)">
		                    <i class="pc-w-arrow-left">&lt;</i>
		                    <strong>选择其他支付方式</strong>
		                </a>
		            </div>-->
		            <!-- payment-change 变更支付方式 end -->
		        </div>
		        <!-- payment 支付方式选择 end -->
		    </div>
		</div>

	<!--循环获取微信支付状态-->
		<script src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
		<script>
			$(function () {
				var myInt = setInterval(function () {
					check()
				},1000);
				function check() {
					var out_trade_no = $('.out_trade_no').val();
					$.ajax({
						type:'post',
						url:"{:U('Pay/orderquery')}",
						data:{'out_trade_no':out_trade_no},
						success:function (e) {
							if(e == 1){
								clearInterval(myInt);
								alert('订单支付成功，点击确认按钮跳转到订单页');
								window.location.href="{:U('Index/shop_order')}"
							}else{
								return false;
							}
						}
					})
				}
			})
		</script>

	<!--后退指定页面-->
		<script>
			pushHistory();
			window.addEventListener("popstate", function(e) {
				window.location = "{:U('Index/shop_order')}";
			}, false);
			function pushHistory() {
				var state = {
					title: "title",
					url: "#"
				};
				window.history.pushState(state, "title", "#");
			}
		</script>
	</body>
</html>
